package com.boco.blch.analysiser.compliance.HW.manager;



import com.boco.blch.analysiser.compliance.ComplianceResolved;
import com.boco.blch.analysiser.util.XmlUtil;

/**
 * @author 黄戈
 * HBase客户端和服务端传输加密安全基线要求项-控制节点
 *
 */

public class BOCO_Hbase_DataEncryptProtect_ClientEncrypt implements ComplianceResolved {
	private final static String HbaseP1 ="hbase.rpc.protection";
	@Override
	public int realEchoResolved(String echoResult) {
		if(!echoResult.equals("")&&echoResult!= null&&(!echoResult.contains(NoPermission1)&&!echoResult.contains(NoPermission2)&&!echoResult.contains(NoPermission3))){
			String ManagerResult=echoResult;//.substring(echoResult.indexOf("manager-start")+"manager-start".length(),echoResult.indexOf("manager-end")).trim();
			if(!ManagerResult.contains(NotFindFile)&&!ManagerResult.contains("boco-HBase-result:error")){
				String HbaseResult1=XmlUtil.getValueByName(ManagerResult,HbaseP1);
				if(HbaseResult1.equals("PRIVACY")){
					return SUCCESS;
				}else{
					return FAILED;
				}
			}else{
				return FAILED;
			}
		}else{
			return FAILED;
		}
		
	}

}
